// — — — — — — — — — — — glwidget.h — — — — — — — — — —
#ifndef GLWIDGET_H
#define GLWIDGET_H
#include <QGLWidget>
#include "Eigen/Dense"

struct Vertex3D
{
    int x,y,z;
};
 typedef Vertex3D BezierSurfaceBMatrix[4][4];

class GLWidget : public QGLWidget
{
Q_OBJECT
public:
 explicit GLWidget(QWidget *parent = 0);
 signals:
public slots:


protected:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();

void mousePressEvent(QMouseEvent *event);

GLuint backgroundimage_;
QVector<QPoint> corners_;
QVector<QPoint> anchors_;
QImage tex_;
void  init_corner_anchors(QVector<QPoint> &corners , QVector<QPoint>& anchors, QImage &img);
void init();

int width_;
int height_;

Vertex3D bezier(double u, double v);
BezierSurfaceBMatrix B_;
};


#endif // GLWIDGET_H
